<!--
- Author:   .
- Date:    2017/7/17 0017.
- File:    password.
-->
<template>
  <div>
    <div class="EditReceiptAddress">
      <ul>
        <li class="sli">
          <div class="lefticon"><i class="iconfont icon-tel"></i></div>
          <div class="fl w550">
            <!--<span>{{memberInfo.member_mobile}}</span>-->
            <input type="text" class="inp" placeholder="输入修改的姓名" v-model="name">
          </div>
        </li>

      </ul>
      <div class="pl20 pr20 mt35"><button type="button" class="but_1 wauto" @click="updatePwd">确定</button></div>
    </div>
    <back-nav></back-nav>
  </div>
</template>

<script>
  import {mapModules, mapRules} from 'vuet'
  import messageCode from '../../components/message-code.vue'

  export default{
    mixins: [
      mapModules({memberInfo: 'memberInfo'}),
      mapRules({once: 'memberInfo'})
    ],
    data() {
      return {
        sendedStyle: {color: '#999999', border: '1px solid #999999'}, // 验证码发送后的验证码按钮样式
        mobile: '',
        pwd: '',
        secode: '',
        imgCode: '', // 图片验证码
        imgCodeSrc: '', // 图片验证码图片地址
        name: ''
      }
    },
    components: {
      'message-code': messageCode
    },
    created() {
    },
    methods: {
      updatePwd() {
        if (this.name == '') {
          this.$toast('请输入姓名')
          return
        }
        this.$request.upDateName(this.name).then(data => {
          this.$toast('设置成功')
          this.$router.go(-1)
        }).catch(e => {
          this.$toast('设置失败:' + e.msg)
          console.error('修改姓名失败', e)
        })
      }
    }
  }
</script>

<style>
  .yanzm {
    width: 4.5rem
  }
</style>
